#include <iostream>

using namespace std;

int a[3000], marked[3000];
int n;
bool answered;

int abs(int x)
{
	if (x < 0) x = -x;
	return x;
}

int main()
{
	while (cin >> n)
	{
		for (int i = 0; i < n; i++) cin >> a[i];

		answered = false;
		memset(marked, false, sizeof(marked));
		for (int i = 0; i < n-1; i++)
		{
			int diff = abs(a[i+1]-a[i]);
			if ((1 <= diff) && (diff <= n-1))
			{
				if (!marked[diff]) marked[diff] = true;
				else
				{
					answered = true;
					cout << "Not jolly" << endl;
					break;
				}
			}
			else
			{
				answered = true;
				cout << "Not jolly" << endl;
				break;
			}				
		}
		if (!answered) cout << "Jolly" << endl;
	}
	return 0;
}
